<template>
  <div class="defect-log-create">
	<view>
		<span class="user">[{{log.createByName}}]</span>
		<span class="state red">{{ $i18n.t('close') }}</span>
	</view>
    <view>
    	<text class="cat2bug-list-item-content">{{createTime(log)}}</text>
    </view>
    <view v-if="showDescribe && log.defectLogDescribe">
      <text class="cat2bug-list-item-content">{{$i18n.t('describe')}}:</text>
      <text class="cat2bug-list-item-content">{{log.defectLogDescribe}}</text>
    </view>
  </div>
</template>

<script>
import {parseTime} from "@/utils/ruoyi"
export default {
  name: "CLOSED",
  props:{
    /** 日志对象 */
    log: {
      type: Object,
      default: ()=>{}
    },
    /** 是否显示描述字段 */
    showDescribe: {
    	type: Boolean,
    	default: true
    }
  },
  computed: {
    head: function () {
      return this.log.receiveByList[0].nickName;
    },
    assistant: function () {
      return this.log.receiveByList.filter((l,i)=>i!=0).map(l=>l.nickName).join(',');
    },
	createTime: function() {
		return function(log) {
			return parseTime(log.createTime, '{y}-{m}-{d} {h}:{i}:{s}')
		}
	}
  },
}
</script>

<style lang="scss" scoped>
.defect-log-create {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  flex-wrap: wrap;
  font-size: 14px;
  span {
    padding-left: 2px;
    padding-right: 2px;
  }
  .user {
    font-weight: 500;
  }
  .state {
    font-size: 14px;
    color: #409EFF;
  }
  .orange {
    color: rgb(255, 186, 0);
  }
  .red {
    color: #FF0000;
  }
}
</style>
